GLOBAL _cpuidasm
EXTERN cpuidFab
EXTERN cpuidBraSt
EXTERN cpuidPS
EXTERN cpuidBra

section .text

_cpuidasm:
	push	ebp			;Armando el Stack Frame
	mov	ebp, 	esp
	push 	eax
	push 	ecx
	push 	edx
	push 	ebx
	
	mov 	eax, 	0h		;
	cpuid				;
	push 	ecx			;ID 
	push 	edx			;FABRICANTES 
	push 	ebx			;
	call 	cpuidFab
	
	MOV   EAX, 80000000h		;
	CPUID				; Verifico si soporta
	CMP   EAX, 80000004h 		;   BRAND STRING
	JB Not_Supported		;
	
	mov 	eax, 	80000002h	;
	cpuid				;
	push 	ecx			; 
	push 	edx			;
	push 	ebx			; 
	push 	eax			;
	call 	cpuidBraSt		;
	mov 	eax, 	80000003h	; BRAND STRING
	cpuid				;
	push 	ecx			; 
	push 	edx			;
	push 	ebx			; 
	push 	eax			;
	call 	cpuidBraSt		;
	mov 	eax, 	80000004h	;
	cpuid				;
	push 	ecx			; 
	push 	edx			;
	push 	ebx			; 
	push 	eax			;
	call 	cpuidBraSt		;
	
Not_Supported:	

	mov 	eax, 	01h		;
	cpuid				;Brand
	push 	ebx			;
	call 	cpuidBra		;	
	
	
	mov 	eax, 	01h		;
	cpuid				;Processor signature
	push 	edx			;
	call 	cpuidPS		;


	pop  	eax
	pop	edx
	pop	ecx
	pop	eax
	leave
	ret
